/**
 * Copyright (C), 2016, JieYi Software System Co., Ltd.
 * All rights reserved.
 * FileName:       BaseDaoMapper.java
 *
 * @Description:
 * @author: victor
 * @version: V1.0
 * Create Date:    2016年7月21日 下午2:04:30
 * <p>
 * Modification History:
 * Date         Author        Version        Discription
 * -----------------------------------------------------------------------------------
 * 2016年7月21日      victor         1.0             add
 */
package com.fengwei.dao;

import com.github.pagehelper.Page;
import org.springframework.dao.DataAccessException;

import java.util.List;

/**
 * @ClassName: BaseDaoMapper
 * @Description: 公共映射mapper
 * @author: victor
 * @date: 2016年7月22日 上午10:01:20
 */
public interface BaseDaoMapper {
    /**
     * @param object
     * @return
     * @throws DataAccessException
     * @Title: selectAll
     * @Description:查询全部
     */
    <T> List<T> selectAll(Object object) throws DataAccessException;

    /**
     * 根据主键查询
     *
     * @param object
     * @return
     * @throws DataAccessException
     */
    <T> T selectByPrimaryKey(Object object) throws DataAccessException;

    /**
     * 根据主键查询-加锁
     *
     * @param object
     * @return
     * @throws DataAccessException
     */
    <T> T selectByPrimaryKeyForUpdate(Object object) throws DataAccessException;

    /**
     * 根据唯一键查询
     *
     * @param object
     * @return
     * @throws DataAccessException
     */
    <T> T selectByUKey(Object object) throws DataAccessException;

    /**
     * 根据唯一键查询-加锁
     *
     * @param object
     * @return
     * @throws DataAccessException
     */
    <T> T selectByUKeyForUpdate(Object object) throws DataAccessException;

    /**
     * 根据条件查询记录条数
     *
     * @param object
     * @return
     */
    int selectCount(Object object) throws DataAccessException;

    /**
     * 分页查询
     *
     * @param object
     * @return
     */
    <T> Page<T> selectByPage(Object object) throws DataAccessException;

    /**
     * 插入
     *
     * @param object
     * @return
     */
    int insert(Object object) throws DataAccessException;

    /**
     * 根据主键更新
     *
     * @param object
     * @return
     */
    int update(Object object) throws DataAccessException;

    /**
     * 根据主键删除
     *
     * @param object
     * @return
     */
    int delete(Object object) throws DataAccessException;
}
